package com.justech.mes.v2.service.offline;


/**
 * Processing before starting work。
 * <p>
 * <strong>Responsibility chain model</strong>
 * Necessary actions need to be done before starting work.：<br/>
 * 1、Check if the user is working in another position: If so, it will help him finish his current job.
 * 2.This is a manual chain of responsibilities. If you want to do more, please plan ahead. Then invoke Method{doSomething}
 * </p>
 * <warning>
 * Once the end of the responsibility chain is not well controlled, recursion will occur.
 * <p>
 * At the very least, the system stops working. <br/>
 * This is also our recommendation to set up the next processor manually.
 * <p>
 *
 * </warning>
 *
 * @author feifei.li
 */
public interface MesJobRegisterBefore {

    /**
     * Pretreatment of work registration
     *
     * @param data     Relevant object information is carried when callbacks are made
     * @param userName
     * @return return self
     */
    MesJobRegisterBefore doSomething(String userName, Object data);


    /**
     * 设置下一个职责执行者
     *
     * @param next
     * @return
     */
    MesJobRegisterBefore next(AbstractMesJobRegisterBefore next);
}
